package net.connection;

import java.net.Socket;

public abstract class Connection {
	private Socket socket;
	private boolean isServer;
	
	public Connection(boolean isServer){
		this.isServer = isServer;
	}
	
	public Socket getSocket(){
		return socket;
	}
	
	protected void setSocket(Socket socket){
		this.socket = socket;
	}
	
	public int getPort(){
		if(isServer)
			return socket.getLocalPort();
		else
			return socket.getPort();
	}
}
